package com.quancheng.component.requestformat.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.AntPathMatcher;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 设置http请求的URI忽略大小写
 * @author zhouchaoqun
 * @email zhouchaoqun@quancheng-ec.com
 * @created 2018/2/2 上午11:54
 */
@Configuration
@ConditionalOnProperty(name = "mvc.config.uri.ignoreCase", havingValue = "true")
public class SpringWebConfig extends WebMvcConfigurerAdapter{
    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
        AntPathMatcher pathMatcher = new AntPathMatcher();
        pathMatcher.setCaseSensitive(false);
        configurer.setPathMatcher(pathMatcher);
    }
}
